<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
	<title>dicitem</title>
	<meta http-equiv="content-type" content="text/html;charset=utf-8" />
	<meta name="generator" content="Geany 0.20" />
	<script type='text/javascript' src='ajax.js'></script>
</head>

<body>

<?php

require_once("dictionary.php");
//require_once("field.php");

class Tovar extends dictionary {
	
	function __construct() {
		parent::__construct();
		$this->id = "uuid1815ecd6cd133026ce44c905ee5a70f6";
		$field = new field();
		$field->name = "priceP";
		$field->onchange = '$this->priceR = $this->priceP * 1.25;';
		$this->fields[] = $field;
		$field = new field();
		$field->name = "priceR";
		$this->fields[] = $field;
	}
	
	
}

/*
class Sotrud extends dictionary {
	
	function __construct() {
		parent::__construct();
		$this->id = "uuid1815ecd6cd1330245e44c905ee5a70f6";
		$field = new field();
		$field->name = "surname";
		$this->fields[] = $field;
		$field = new field();
		$field->name = "bithday";
		$this->fields[] = $field;
		
		$tabular = new tabular();
		$tabular->name = "semia";
		$tabular->id = "uuid1813ecd6cd133026ce44c905ee5a70f6";
		$field = new field();
		$field->name = "named";
		$tabular->fields[] = $field;
		$field = new field();
		$field->name = "surname";
		$field->onchange = '$this->named = $this->surname ." ". $this->forfather;';
		$tabular->fields[] = $field;
		$field = new field();
		$field->name = "forfather";
		$field->onchange = '$this->named = $this->surname ." ". $this->forfather;';
		$tabular->fields[] = $field;
		$this->tabulars[] = $tabular;
	}
}
*/



$tov = new Tovar();
//$tov->add();
//$tov->name = "Молоко";
//$tov->priceP = "5.6";
//$tov->save();
//$tov->createDB();
$tov->itemform();
echo "<pre>".print_r($tov,1)."</pre>";

/*
$sotr = new Sotrud();
$sotr->add();
$sotr->name = "name";
$sotr->surname = "surname";
$sotr->save();
$sotr->semia->add();
$sotr->semia->surname = "putin";
$sotr->semia->forfather = "vladimir";
$sotr->semia->save();
$sotr->createDB();
*/
//echo "<pre>".print_r($tov,1)."</pre>";
//echo "<pre>".print_r($sotr->fields,1)."</pre>";

//require_once($_SERVER['DOCUMENT_ROOT']."/classes/System/osmetadata.php");

/*
$tovar = $metadata->dictionaries->byname("Товар");
$tovar->Наименование = "Молоко";
$tovar->ЦенаП = 7.45;

echo $tovar->fields->byuuid("uuid658528fa41651ebb3a643ef286d391f2")->form->get($tovar);
echo $tovar->fields->byuuid("uuidff7622100858efb9c3890fcf44d1bb01")->form->get($tovar);


echo "<pre>".print_r($tovar,1)."</pre>";
*/

?>

	
</body>

</html>
